/*
admin_verb.dm
The administrative verbs used in ANLII.

Included:
	announce		announce a message to the world
	swapadmin		change yourself into or out of admin mode
	delallby (t)	delete all by t
*/

mob/player/verb

	announce(t as text|message)
		if(!check_admin())return
		world << "<center>Announcement from [src]:</center>"
		world << "<center><big>[t]</big></center>"

	swapadmin()
		if(!check_admin())return
		if(!client.adminMode)
			winset(src,"admin.button","text=\"Exit Admin Mode\"")
			client.adminMode=1
		else
			winset(src,"admin.button","text=\"Enter Admin Mode\"")
			client.adminMode=0

	delallby(t as text)
		if(!check_admin())return
		if(alert(src,"Are you sure you want to delete all built objects by [t]?","Deletion","Yes","No"=="Yes"))
			var/verf
			for(var/obj/builditems/b in world)
				if(b.builtowner==t)
					b.deletion()
					verf=1
			if(verf)
				world.log << "[src] ([key]) deleted all of [t]'s objects"
				announce("I have deleted all of [t]'s built objects. Let that be a warning to you all.")

	create_item()
		if(!check_admin())return
		var/obj/x = input("Create what?") in typesof(/obj/gettable/)
		var/obj/o = new x(loc)
		view() << "\An [o] appears at [src]\s feet."

	warp(x as num, y as num, z as num)
		loc = locate(x,y,z)

	//float, warp, other standard gm stuff

mob/player/proc/check_admin()
	return (ckey in admins)